<% lineconst = 4%>
<% linenum = catlist.size/lineconst%>
<% leftnum = catlist.size%lineconst%>
<%= catlist[0].parent.title%>下子分类<br/>
<table width="100%">
<% for i in 0...linenum
%>
     <tr>
     <% for j in 0...lineconst
     %>
       <td width="<%= 100/lineconst %>%">
       <%= link_to "#{catlist[i*lineconst+j].title}(#{catlist[i*lineconst+j].common_posts_by_community(@community).size})", :controller => 'communities', :action => 'posts', :id => @community, :cat => catlist[i*lineconst+j] %>
       </td>
     <%
     end
     %>
     </tr>
<%
   end
%>
<% if leftnum > 0%>
  <tr>
  <% for i in 0...leftnum%>
    <td width="<%= 100/lineconst %>%">
    <%= link_to "#{catlist[linenum*lineconst+i].title}(#{catlist[linenum*lineconst+i].common_posts_by_community(@community).size})", :controller => 'communities', :action => 'posts', :id => @community, :cat => catlist[linenum*lineconst+i] %>
    </td>
  <% end %>
  <% for i in 0...(lineconst-leftnum)%>
    <td width="<%= 100/lineconst %>%">
    &nbsp;
    </td>
  <% end %>
  </tr>
<% end %>
</table>